Repository navigation
ci: prepare release drafts before tagging - #11569
Conversation
Build release-version commits before maintainers publish their signed tags. Stage the successful build as a draft and cover preparation and skipping behavior with focused local workflow tests.
|
Thanks for working on this. I think this improves the release process, but it does not fix the race we actually encountered. The failure mode was roughly:
This workflow prepares a draft from What this PR does protect against is a different and useful failure mode: publishing a permanent tag and only then discovering that release-note validation, packaging, or artifact upload fails. That is worthwhile, but I don't think we should describe it as fixing the intervening-merge/stale-base incident. To cover that incident, I think the release cut needs to be serialized:
The draft's explicit Could we either add that enforcement as part of this change, or narrow the stated goal to "prepare and validate release artifacts before publishing the tag" and track the stale-base/release-freeze fix separately? |
Wait for the draft preparation run before signing and pushing the exact tested release commit. Route RC and patch releases through the same procedure and explain cleanup before retrying stale draft preparation.
9014786 to
9c415d2
Compare
we should fix one thing as a time, this PR aims at preventing wasting tags we push. |
litbot-9000
left a comment
There was a problem hiding this comment.
/gateway review
Verdict: LGTM — no issues found, approval warranted. Posted as a comment rather than an approval because the review requester on my side is not the workspace approver; the technical verdict is a clean pass.
What was verified (at head 9c415d2)
Trigger/mechanism review
- New triggers are exactly
pushtov0.*-branchwithpaths: build/version.goplusworkflow_dispatch; the oldv*tag trigger is fully removed, so pushing the signed tag cannot rerun the build.fetch-depth: 0keeps tags available, so thegit show-ref --verify refs/tags/$tagskip actually works in CI. lnd --versionprintslnd version <ver> commit=<c>(config.go:933), soawk '{print $3}'extracts the version; field position is robust to the temp binary name undergo run.make release tag=$RELEASE_VERSIONrunsrelease.sh check-tag, which requires$tag == $(git describe --tags). Confirmed withmake -n release tag=v0.21.9-betaand a local tag experiment: untagged HEAD describes as<nearest>-<n>-g<sha>(check would fail), a local tag at HEAD describes exactly as the tag (check passes). The local unsigned tag in the prepare step is what satisfies this.check-release-notes-consistency.sh releasereads the version frombuild/version.goand has no pushed-tag dependency, so it works on the untagged bump commit.docs/ci-runs.mdtrigger description matches the workflow; no stale "tag push triggers release build" references remain;scripts/tag-release.shdoes verify HEAD-in-sync-with-upstream as the docs claim.
Execution of the new guards (fixture replication of scripts/release-workflow_test.sh)
No Ruby in my environment, so I extracted the prepare block from the YAML verbatim (indent-aware awk, compared against the file) and ran the test's exact scenarios in fixture git repos:
- new release → exports
RELEASE_VERSION, creates only a local lightweight tag at HEAD, nothing pushed: pass - dev version
0.21.99-beta→ skips, no tag, no export: pass - already-tagged
v0.21.9-beta→ skips, original tag object preserved: pass - extra:
0.21.0-beta.rc1preparesv0.21.0-beta.rc1: pass - extra:
0.21.9-beta.99is not caught by the.99dev regex: pass
Mutation tests — both new guards are pinned:
- dev regex neutralized (
.99→.98) → dev version gets tagged; fixture catches it. - tag-existence check neutralized (
if false && ...) → re-tag attempted,git tagfails "already exists"; fixture catches it.
Lint/syntax
- actionlint 1.7.7: clean on
release.yaml. - shellcheck 0.10.0: clean on
scripts/release-workflow_test.shand on the extracted prepare block;bash -nclean on all touched shell. - 80-col: three added lines exceed 80 (release-body URL, markdown table row, one 83-char shell line) — none in lint-covered Go code; CI lint agrees (green).
CI at head: all checks green (Lint, Static Checks, both unit suites, Check commits incl. signed-commit audit, cross compilation, release-notes checks).
What was not verified
- An end-to-end run of the modified workflow (only triggers on release branches / dispatch); the draft-creation step itself has not executed here.
- The exact draft-reuse semantics of the pinned
lightninglabs/gh-actions/action-gh-release@c7149b6a(softprops fork) behind the retry doc's pagination claim — the guidance (stop runs, delete stale drafts before retry) is conservative and safe either way. - The Ruby version of the fixture test was not run as-is (no Ruby in my env); it was replicated step-for-step instead.
Required changes
None.
Non-blocking nit
One inline: the fixture test guards a real contract but is not wired into CI.
— claudell ⚡ (OpenClaw dev agent; this review posts as litbot-9000 and does not count toward branch protection)
| @@ -0,0 +1,123 @@ | |||
| #!/bin/bash | |||
There was a problem hiding this comment.
Non-blocking: this guards the workflow contract (triggers, draft settings, prepare-step semantics), but nothing in CI runs it, so a future edit to release.yaml could silently break the contract it pins. Worth wiring into an existing shell/static-check job (it only needs bash, git, ruby — no Docker) in a follow-up.
ziggie1984
left a comment
There was a problem hiding this comment.
ACK. The build-before-tag flow makes sense: the version bump prepares artifacts in a commit-pinned draft first, while the real signed tag remains an explicit maintainer step before publication.
Summary
Prepare release artifacts before publishing signed tags so notes or build
failures do not consume release versions.
Change Description
branch and changes
build/version.go.the updated release branch.
CI builds using a local unsigned tag and uploads assets to a draft tied to the
tested commit. Maintainers then sign and push that tag and publish the draft.
Add focused workflow tests and update the release procedures. Actionlint,
ShellCheck, local fixture tests, and signed-commit audits pass.